/**
 * @author Semper
 */
import React from "react";
import { StatusBar, StyleSheet, Text, Image, View, TouchableOpacity, Share } from "react-native";
import Device from "../util/device";
import Ionicons from 'react-native-vector-icons/Ionicons';

class AboutUsPage extends React.Component {


    componentDidMount() {
        fetch("http://27.102.66.201:8080/api/create_name", {
            method: "POST",
            headers: {
                "content-type": "application/json"
            },
            body: JSON.stringify({
                "x": "李",
                "xb": "男",
                "csrq": "2023年3月19日 17点55分",
                "csdd": "广东省深圳市",
                "jy": "",
                "zs": 3
            })
        })
            .then((response) => {
                return response.json()
            })
            .catch((error) => {
                console.warn("error", error)
            }).then((responseData) => {

                console.warn("responseData", responseData);
            }).done();
        // fetch("http://27.102.66.201:8080/api/create_name", {
        //     headers: {
        //         "content-type": "application/json"
        //     },
        //     method: "POST",
        //     body: JSON.stringify({
        //         "x": "李",
        //         "xb": "男",
        //         "csrq": "2023年3月19日 17点55分",
        //         "csdd": "广东省深圳市",
        //         "jy": "",
        //         "zs": 3
        //     })

        // }).then((response) => {
        //     //处理http响应
        //     console.warn(response.json())
        // }, (error) => {
        //     //处理错误
        //     console.warn("error", error)
        // })
    }
    render() {
        return (
            <View style={{ backgroundColor: '#fff', flex: 1 }}>
                <View style={{ alignSelf: 'center', marginTop: 40, justifyContent: 'center', alignItems: 'center' }}>
                    <View style={{ width: 70, height: 70, borderRadius: 35, justifyContent: 'center', alignItems: 'center' }}>
                        <Image style={{ width: 70, height: 70, borderRadius: 35, }} source={require('../../img/appicon.png')}/>
                    </View>

                    <Text style={{ fontWeight: 'bold', marginTop: 20, fontSize: 20 }}>起名册子应用</Text>
                    <Text style={{ marginTop: 18 }}>Version 1.0.0.125</Text>

                </View>
                <TouchableOpacity
                    style={{
                        position: 'absolute',
                        bottom: 42,
                        // borderTopWidth: StyleSheet.hairlineWidth,
                        borderColor: '#eee',
                        alignSelf: 'center'
                    }}
                    onPress={() => {
                        // this.showIsClearCache()
                        Share.share({ message: "《起名册子》是一款很好用的智能起名应用，现在推荐给你。请在App Store应用商店下载。", title: "起名册子", url: "https://apps.apple.com/cn/app/起名册子-孩子取名起名字大全/id6450860414" })

                    }}>


                    <Text style={{ color: "#262626", fontSize: 12, fontWeight: 'bold' }}>分享给好友</Text>

                    {/* <TouchableOpacity
                        style={{ flexDirection: 'row', alignItems: 'center', alignContent: 'center', marginTop: 10}}
                    >
                        <Ionicons
                            style={{}}
                            name='share-outline'
                            size={12}
                            color={"#000"}
                        />
                        <Text style={{ color: '#000', fontSize: 12, marginStart:3}}>分享给好友</Text>
                    </TouchableOpacity> */}
                </TouchableOpacity>

            </View>

        )
    }
}
const styles = StyleSheet.create({
    item: {
        backgroundColor: '#fff',
        flexDirection: 'row',
        justifyContent: 'space-between',
        alignItems: 'center',
        paddingLeft: 18,
        paddingVertical: 14,
        paddingRight: 18,
        // paddingHorizontal:18,
        borderTopWidth: StyleSheet.hairlineWidth,
        borderTopColor: '#EEE'
    },
    itemLeft: {
        flexDirection: 'row',
        alignItems: 'center'
    },
    itemLeftText: {
        // paddingLeft: 10,
        fontSize: 16
    },
});

export default AboutUsPage;
